# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-weakrefmethod
pkgname=('python2-weakrefmethod' 'python-weakrefmethod')
_pkgname=weakrefmethod
pkgver=1.0.3
pkgrel=7
pkgdesc='A WeakMethod class for storing bound methods using weak references.'
url='https://pypi.org/project/weakrefmethod/#files'
arch=('any')
license=('Python')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('c68dc806904eb954319984003506eb9b552005ce04722c6a3eb123ecde8f4413f9f9d114f0923c6f6ae2e25b4dbaf8c225c070a1720a6563cf1517f2411a60d5')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-weakrefmethod() {
  depends=('python2')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

package_python-weakrefmethod() {
  depends=('python')

  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

